package com.ruoyi.system.controller;

import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.core.page.TableDataInfo;
import com.ruoyi.system.domain.Company;
import com.ruoyi.system.service.ICompanyService;
import com.ruoyi.system.service.ILoansService;
import com.ruoyi.system.service.ISysNoticeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/system/count")
public class CountController extends BankController{

    @Autowired
    private ICompanyService companyService;

    @Autowired
    private ISysNoticeService noticeService;

    @Autowired
    private ILoansService loansService;

    /**
     * 查询企业列表
     */
    @GetMapping("/companyCount")
    public AjaxResult companyCount()
    {
        return AjaxResult.success(companyService.selectCompanyCount());
    }

    /**
     * 查询通知数量
     */
    @GetMapping("/noticeCount")
    public AjaxResult noticeCount()
    {
        return AjaxResult.success(noticeService.selectNoticeCount());
    }

    /**
     * 查询交易金额
     */
    @GetMapping("/loaMoney")
    public AjaxResult loaMoney()
    {
        return AjaxResult.success(loansService.selectLoaMoney());
    }

    /**
     * 查询贷款数量
     */
    @GetMapping("/loaCount")
    public AjaxResult loaCount()
    {
        return AjaxResult.success(loansService.selectLoaCount());
    }
}
